//配置访问url
//url = "http://10.8.30.55/bxld-web/";
url = "http://172.16.230.97:8080/bxld-web/";
//url = "http://47.96.0.191:8080/bxld-web/";

//openId
openId = $.cookie("openId");
//openId = "oqH0b1VgH5p4bYnC72iJDsdVdE8M";
//openId = "ot9pV06EmRT0hrTiq4zudDWhwNvk";

var wxAuthTo = window.location.href;

if(openId == null){
    var id = GetQueryString("openId");
    if(id == "" || id == null || id == undefined){
        window.location.href = url + "weixin/toOauth.do?wxAuthTo="+ wxAuthTo;
    }else{
        $.cookie("openId", id);
        openId = id;
    }
}else{
    console.log(openId);
}


//获取url参数
function GetQueryString(name){
    var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if(r!=null)return  decodeURI(r[2]); return null;
}

